#ifndef PROGCONN_H
#define PROGCONN_H


#include "connect.h"
#include "progserv.h"

class ProgressiveConnection : public Connection
{
	public:
		ProgressiveConnection(ProgressiveServer* server, SOCKET client);
		~ProgressiveConnection();

        int32 getProgressiveJackpot();

        bool8 isProgressiveOn();

        // kharmon.  10-05-05.  #5861.  Added bPercentage parameter so that a payrate of less than 100 can 
        // optionally be treated as an absolute amount.
        bool8 setProgressiveWinner(int32 payrate, int32* payout, int32* multiBankPayout, bool bPercentage = true);

        bool8 placeProgressiveBet(int32 betAmount, int32& multiBankBet);
		bool8 placeProgressiveBet(int32 betAmount, int32 betMultiplier, int32& multiBankBet);
		bool8 placeProgressiveContribution(int32 nContributionAmount, int32& multiBankBet);

		int32 getProgressiveJackpotID() { return jackpotID; };

	protected:

        //this function needs to be implemented by the subclass in the std cpp file to have access to the
        //forMoney flag in the CasinoInfo structure
        virtual bool8 getForRealFlag() = 0;
		virtual int32 getProgressiveFixedAmountMultiplier() = 0;

        void getProgressiveData(int32* jackpot, int32* rate);
        void setProgressiveOn(bool8 progressiveOn);
        void setProgressiveJackpotID(int32 progJackpotID);

		// [AO 2007-06-08] Extracted the jackpot notification message
		void SendJackpotCandidateMail(String const& host_name,		// SMTP host
									  String const& name_from,		// Comment attached to "From:" address
									  String const& subject_suffix,	// String to put in subject end
									  String const& message,		// Message text
									  bool8 is_real);				// Real or Fun game?

	protected:
        ProgressiveServer* pProgServ;
        int32 jackpotID;
};

#endif
